package crawler;

import java.awt.Color;
import java.util.Date;

public class GnutellaNode extends GraphNode
{
	private String mAddress;
	private boolean mIsUltraPeer;
	private long mLastTimeCrawled;
	private String mFileList;
	private CrawlResultVector mResult;
	
	public GnutellaNode(String address, boolean isUltraPeer)
	{
		super();
		mAddress = address;
		mIsUltraPeer = isUltraPeer;
		mLastTimeCrawled = 0;
		mResult = null;
		
		if(mIsUltraPeer)
		{
			SetColor(Color.green);
		}
		else
		{
			SetColor(Color.red);
		}
	}
	
	public void SaveLatestResult(CrawlResultVector result)
	{
		mResult = result;
	}
	
	public CrawlResultVector GetLatestResult()
	{
		return mResult;
	}
	
	public long GetLastTimeCrawled()
	{
		return mLastTimeCrawled;
	}
	
	public void SetLastTimeCrawled()
	{
		mLastTimeCrawled = new Date().getTime();
	}
	
	public String GetAddress()
	{
		return mAddress;
	}
	
	public boolean GetIsUltrapeer()
	{
		return mIsUltraPeer;
	}
}
